package com.oms.app.order.model;

import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.oms.base.JSONDateTimeSerializer;
import com.oms.util.DateUtil;

/**
 * ORDERS表对应实体
 * @author Loong_Mit
 * @date Sep 1, 2012 12:30:07 PM
 */

public class Order {
	private Integer id;
	private Integer shopid;
	private Integer usid;
	private String regname = "";
	private String name = "";
	private Date createtime;
	private Float totalprice;
	private String orderdeclare = "";
	private Integer status = 0;
	private String acceptime;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getShopid() {
		return shopid;
	}
	public void setShopid(Integer shopid) {
		this.shopid = shopid;
	}
	public Integer getUsid() {
		return usid;
	}
	public void setUsid(Integer usid) {
		this.usid = usid;
	}
	@JsonSerialize(using=JSONDateTimeSerializer.class)
	public Date getCreatetime() {
		return this.createtime;
	}
	public void setCreatetime(Date createtime) {
		if (createtime == null) {
			this.createtime = new java.util.Date();
		}
		this.createtime = createtime;
	}
	public Float getTotalprice() {
		return totalprice;
	}
	public void setTotalprice(Float totalprice) {
		this.totalprice = totalprice;
	}
	public String getOrderdeclare() {
		return orderdeclare;
	}
	public void setOrderdeclare(String orderdeclare) {
		this.orderdeclare = orderdeclare;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getAcceptime() {
		return acceptime.indexOf(".0") > 0 ? acceptime.substring(0, acceptime.length() - 2) : acceptime;
	}
	public void setAcceptime(String acceptime) {
		if (acceptime == null) {
			this.acceptime = DateUtil.getCurrentFullString();
		}
		this.acceptime = acceptime;
	}
	public String getRegname() {
		return regname;
	}
	public void setRegname(String regname) {
		this.regname = regname;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
}